package menu

import (
	"fmt"
	"mass-user/client/processor"
)
var (
	userId int64
	pwd string
	username string
	up = &processor.UserProcess{}
)

func NotLoginMeum() {
	var key int
	for {
		fmt.Println("==============欢迎登录多人聊天系统==============")
		fmt.Println("\t\t 1. 登录聊天室")
		fmt.Println("\t\t 2. 注册账号")
		fmt.Println("\t\t 3. 退出聊天室")

		fmt.Scanf("%d\n", &key)
		switch key {
		case 1:
			fmt.Println("请输入userId：")
			fmt.Scanln(&userId)
			fmt.Println("请输入密码：")
			fmt.Scanln(&pwd)
			_ = up.Login(userId, pwd)
		case 2:
			fmt.Println("请输入userId：")
			fmt.Scanln(&userId)
			fmt.Println("请输入密码：")
			fmt.Scanln(&pwd)
			fmt.Println("请输入昵称：")
			fmt.Scanln(&username)
			_ = up.Register(int(userId), pwd, username)
		case 3:
			fmt.Println("login")

		default:
			fmt.Println("输入有误")
		}
	}
}
